package org.com.app.knock.fragment;

import org.com.app.knock.activity.LoginActivity;
import org.com.app.knock.activity.RegisterActivity;
import org.com.app.knock.activity.SplashActivity;

import z.lib.base.CommonAndroid;
import z.lib.base.LogUtils;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

import com.acv.libs.nbase.BaseActivity;
import com.acv.libs.nbase.BaseFragment;
import com.knock.app.R;

public class UserMainFragment extends BaseFragment implements AnimationListener {
	private static final String TAG = "UserMainFragment";
	private View views;

	public UserMainFragment() {
		super();
	}

	@Override
	public void setUpFragment(View view) {
		this.views = view;
		CommonAndroid.getView(view, R.id.user_login).setOnClickListener(this);
		CommonAndroid.getView(view, R.id.btn_back).setOnClickListener(this);
		CommonAndroid.getView(view, R.id.user_signin).setOnClickListener(this);
	}

	@Override
	public int layoytResurce() {
		return R.layout.user;
	}
	
	@Override
	public void onClick(View v) {
		super.onClick(v);
		int idView = v.getId();
		Intent Page;
		
//		Intent intent = new Intent(getActivity(), SplashActivity.class);
//		getActivity().finish();
//        startActivity(intent); 
//        
//		Intent PageDetail = new Intent(getActivity(), SplashActivity.class);
//    	getActivity().startActivity(PageDetail); 
    	
		switch (idView) {
		case R.id.user_login:
			Page = new Intent(getActivity(), LoginActivity.class);
			getActivity().startActivityForResult(Page,0); 
			break;
		case R.id.btn_back:
			getActivity().finish();
			break;
		case R.id.user_signin:
			Page = new Intent(getActivity(), RegisterActivity.class);
			getActivity().startActivityForResult(Page,0); 
			break;
		default:
			break;
		}
	}

	@Override
	public void onAnimationStart(Animation animation) {

	}

	@Override
	public void onAnimationEnd(Animation animation) {
		mHandle.sendEmptyMessage(0);
	}

	@Override
	public void onAnimationRepeat(Animation animation) {

	}
}